<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
<%@page import="util.Constant"%>
<!--Hier fuegt man seinen Arbeitsgeber  oder Firmennamen ein und beschreibt von wann bis wann man in der Firma gearbeitet hat... -->
<%String file="./index.jsp?"+Constant.CONTENT+"="+Constant.add_activity, method="get"; %>
<%@page import="db.DBMain"%>
<%RequestParser.send_action_file=file;
RequestParser.send_method=method;%>
<%@include file="town.jsp" %>
<%@page import="html.RequestParser"%>
<%@page import="db.tables.DBTypeTable"%>
<%@page import="db.tables.DBSchoolTable"%>
<%@page import="db.tables.DBActivityTable"%>
<script type="text/javascript"><!--

<%
Long type_id_temp=DBMain.getTypeTable().selectLong(DBTypeTable.TYPE_ID_COL,DBTypeTable.TYPE_NAME_COL,Constant.Type.ACTIVITY),
	user_id=0L, cat_id=RequestParser.getLongFromParameter(request,Constant.Content.CATEGORY);//session.getAttribute(Constant.USERID);
session.setAttribute(Constant.Content.TYPE,type_id_temp);

RequestParser activityParser=new RequestParser(request,file,method);
activityParser.isAdmin(true);
activityParser.setAdd(Constant.Content.ADD_ACTIVITY);
activityParser.setContent(Constant.Content.ACTIVITY);
activityParser.setSubmit(Constant.Content.SUBMIT_ACTIVITY);
activityParser.setDelete(Constant.Content.DELETE_ACTIVITY);
activityParser.setInput(new String[]{Constant.Content.INPUT_ACTIVITY,Constant.Content.TOWN,Constant.Content.CATEGORY});
activityParser.setInsert_columns(new String[]{DBActivityTable.ACTIVITY_NAME_COL,DBActivityTable.TOWN_ID_COL,DBActivityTable.CATEGORY_ID_COL});
activityParser.setDisplay_columns(new String[]{DBActivityTable.ACTIVITY_ID_COL,DBActivityTable.ACTIVITY_NAME_COL,DBActivityTable.CATEGORY_ID_COL});
activityParser.setPk_column(DBActivityTable.ACTIVITY_ID_COL);
activityParser.setTable(DBMain.getActivityTable());
activityParser.setFk_columns(new String[]{DBActivityTable.TOWN_ID_COL,DBActivityTable.CATEGORY_ID_COL});
activityParser.setFk_ids(new Long[]{town_id,cat_id});
activityParser.process();

%>
//
--></script>
<form name="<%=activityParser.getContent() %>" action="<%=activityParser.getSend_action_file() %>" method="<%=activityParser.getSend_method()%>">
<%@include file="category_only.jsp" %>
	<select name="<%=activityParser.getContent() %>" onchange="submit()">
		<%
			activityParser.printOptionList(out);
		%>
	</select>
<% if(admin) { %>
	<input type="hidden" name="<%=Constant.Content.CATEGORY %>" value="<%=categoryParser.getPk_id() %>"/>
    <input type="hidden" name="<%=Constant.Content.COUNTRY %>" value="<%=country_id %>"/>
	<input type="hidden" name="<%=Constant.Content.TOWN %>" value="<%=town_id %>"/> 
     <input name="<%=activityParser.getContent()%>" type="hidden" value="<%=type_id_temp %>"/>
	<input name="<%=activityParser.getDelete() %>" value="<%=Constant.Content.DELETE %>" type="submit"/>
<% } %>
<% if(admin) { %>
	<table>
	<tr><td>Aktivit&auml;t</td></tr>
	<tr>
	<td><input name="<%=activityParser.getInput()[0] %>" type="text"/></td>
	</tr></table>
    <input type="hidden" name="<%=activityParser.getContent() %>" value="<%=activityParser.getPk_id()%>"/>
    <input type="hidden" name="<%=Constant.Content.COUNTRY %>" value="<%=country_id %>"/>
	<input type="hidden" name="<%=Constant.Content.TOWN %>" value="<%=town_id %>"/> 
	<input name="<%=activityParser.getSubmit() %>" type="submit"/>
	<input type="reset" name="Zur&uuml;cksetzen" value="Zur&uuml;cksetzen">
</form>
<%}%>